/*
作者：江怀玉
日期：2014-06-10
功能：弹出菜单
解决：
-------------------------------------
依赖JS:
jquery,jquery.data
依赖CSS：

---------------------------------------------------------*/
//初始化控件
(function ($) {
    $.fn.FiexedMenu = function () {
        var $this = this;
        var h = $(window).height();
        $(this).height(h - 35-35);
        $(this).find(".left_fixed_menu_content").height(h - 55-35);
        function fnExpand() {
            $($this).animate({ left: "0px" });
        }
        function fnCollapse() {
            $($this).animate({ left: "-250px" });
        }
        $(this).find("span").click(function () {
            if ($(this).text() == "展开") {
                $(this).html("隐藏");
                fnExpand();
            } else {
                $(this).html("展开");
                fnCollapse();
            }
        });
    }
})(jQuery);

$(document).ready(function () {
    if (getPar1("entity") == "V_CrmCustomerDependent" && getPar1("condition") == "CustomerStatus=8") {
        $("body").append("<div id='left_fixed_menu' style='position:fixed; z-index:99999;width:250px;background-color: #6699cc;border:solid 2px #ddd;top:35px;left:-250px;'>"
    + "<span style='position:relative;left:250px;top:-2px;color:#fff;width:15px;background-color: #6699cc;border:solid 2px #ddd;border-left:solid 0px;'>展开</span>"
    + "<div class='left_fixed_menu_content' style='padding:3px;background-color:#fff'>"
    + "<iframe id='tree' frameborder='0' src='/ExtendPage/CtrlPage/TreePersonData.aspx?type=selfDeptData&t=1' style='width: 100%; height: 99%;margin: 0px; padding: 0px;'></iframe>"
    +"</div>"
    + "</div>");
    $("#left_fixed_menu").FiexedMenu();
    }
});


